package com.akino.gulimall.cart.service;

import com.akino.gulimall.cart.vo.Cart;
import com.akino.gulimall.cart.vo.CartItem;

import java.util.List;
import java.util.concurrent.ExecutionException;

/**
 * @author Akino
 * @version 1.0
 */
public interface CartService {

    /**
     * 添加到购物车
     */
    CartItem addToCart(Long skuId, Integer num) throws ExecutionException, InterruptedException;

    /**
     * 根据skuId获取cartItem
     */
    CartItem getCartItem(Long skuId);
    /**
     * 获取整个购物车
     */
    Cart getCart() throws ExecutionException, InterruptedException;
    /**
     * 清空临时购物车
     */
    void clearCart(String cartKey);
    /**
     * 勾选购物项
     */
    void checkItem(Long skuId, Integer check);
    /**
     * 修改购物项数量
     */
    void changeItemCount(Long skuId, Integer num);

    /**
     * 删除购物项
     */
    void deleteItem(Long skuId);

    List<CartItem> getUserCartItems();
}
